/**
 * @fileOverview hover edge control point
 * @author huangtonger@aliyun.com
 */
const Page = require('../../base/');
const Global = require('../global');

Page.registerBehaviour('hoverEdgeControlPoint', diagram => {
  const graph = diagram.getGraph();
  graph.behaviourOn('edgeControlPoint:mouseenter', ev => {
    if (diagram.getSignal('dragEdge') || diagram.getSignal('panningItem')) {
      return;
    }
    const controlPoint = ev.shape;

    if (controlPoint.isTargetEndPoint() || controlPoint.isSourceEndPoint()) {
      diagram.css({
        cursor: Global.cursor.hoverEdgeControllPoint
      });
    }
  });
});
